home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update26.zoo / util / diffs next >
Encoding:
Text File  |  1992-11-07  |  11.3 KB  |  407 lines

  1. *** 1.33    1992/10/11 02:39:24
  2. --- Changelog    1992/11/08 00:48:18
  3. ***************
  4. *** 377,379 ****
  5. --- 377,393 ----
  6.   cnm.c:: ++jrb
  7.       cleanup for hpux
  8.   ----------------------------- Patchlevel 32 --------------------------------
  9. + ld.c:: howard
  10. +     more fixes for baserel
  11. + ld.c:: ++jrb
  12. +     fixed BYTE_SWAP problem.
  13. + ld.c:: ++jrb
  14. +     more BYTE_SWAP fixes in the relocation stuff
  15. + toglclr.c: Thomas Schulze, ts@uni-paderborn.de
  16. +     add -fshare flag for sharex text (mint 0.96 and up).
  17. + ----------------------------- Patchlevel 33 --------------------------------
  18. *** 1.30    1992/10/11 02:39:24
  19. --- PatchLev.h    1992/11/08 00:48:20
  20. ***************
  21. *** 1,4 ****
  22. ! #define PatchLevel "32"
  23.   
  24.   /*
  25.    *    the Patch Level above is to identify the version
  26. --- 1,4 ----
  27. ! #define PatchLevel "33"
  28.   
  29.   /*
  30.    *    the Patch Level above is to identify the version
  31. *** 1.37    1992/10/11 02:39:24
  32. --- ld.c    1992/11/08 00:48:25
  33. ***************
  34. *** 2176,2181 ****
  35. --- 2176,2189 ----
  36.   
  37.         /* Grab the next entry.  */
  38.         p++;
  39. + #ifdef BYTE_SWAP
  40. + if (entry->superfile==NULL) {
  41. + p->n_un.n_strx = SWAP4(p->n_un.n_strx);    /* oochie wow-wow ??!!! -- ko */
  42. + p->n_desc      = SWAP2(p->n_desc);
  43. + p->n_value     = SWAP4(p->n_value); }
  44. + #endif /* BYTE_SWAP */
  45.         if (p->n_type != (N_UNDF | N_EXT))
  46.           {
  47.             fprintf (stderr, "%s: Warning symbol found in %s without external reference following.\n",
  48. ***************
  49. *** 2629,2634 ****
  50. --- 2637,2649 ----
  51.         if (index < 0 || index >= length_of_strings
  52.         || (index && *(sym_name_base + index - 1)))
  53.       fatal_with_file ("malformatted __.SYMDEF in ", entry);
  54. + #ifdef BYTE_SWAP
  55. +       if(sizeof(symdef_base[i].library_member_offset) == 4)
  56. +         symdef_base[i].library_member_offset = SWAP4(symdef_base[i].library_member_offset);
  57. +       else
  58. +         symdef_base[i].library_member_offset = SWAP2(symdef_base[i].library_member_offset);
  59. + #endif
  60.       }
  61.   
  62.     /* Search the symdef data for members to load.
  63. ***************
  64. *** 2663,2676 ****
  65.           register int j;
  66.           register int offset;
  67.           struct file_entry *subentry;
  68. - #ifdef BYTE_SWAP
  69. - if (sizeof(symdef_base[i].library_member_offset)==4)
  70. -   symdef_base[i].library_member_offset = SWAP4(symdef_base[i].library_member_offset);
  71. - else
  72. -   symdef_base[i].library_member_offset = SWAP2(symdef_base[i].library_member_offset);
  73. - #endif /* BYTE_SWAP */
  74.   
  75. ! offset = symdef_base[i].library_member_offset;
  76.   
  77.           /* Don't think carefully about any archive member
  78.              more than once in a given pass.  */
  79. --- 2678,2685 ----
  80.           register int j;
  81.           register int offset;
  82.           struct file_entry *subentry;
  83.   
  84. !                 offset = symdef_base[i].library_member_offset;
  85.   
  86.           /* Don't think carefully about any archive member
  87.              more than once in a given pass.  */
  88. ***************
  89. *** 4357,4371 ****
  90.        struct relocation_info *p;
  91.        struct file_entry *entry;
  92.   {
  93. !   register int symindex = RELOC_SYMBOL (p) * sizeof (struct nlist);
  94. !   register symbol *sp = ((symbol *)
  95. !             (((struct nlist *)
  96. !               (((char *)entry->symbols) + symindex))
  97. !              ->n_un.n_name));
  98.   
  99.     if (symindex >= entry->header.a_syms)
  100.       fatal_with_file ("relocation symbolnum out of range in ", entry);
  101.   
  102.   #ifdef N_INDR
  103.     /* Resolve indirection */
  104.     if ((sp->defined & ~N_EXT) == N_INDR)
  105. --- 4366,4382 ----
  106.        struct relocation_info *p;
  107.        struct file_entry *entry;
  108.   {
  109. !   register int symindex;
  110. !   register symbol *sp;
  111. !   symindex = RELOC_SYMBOL (p) * sizeof (struct nlist);
  112.   
  113.     if (symindex >= entry->header.a_syms)
  114.       fatal_with_file ("relocation symbolnum out of range in ", entry);
  115.   
  116. +   sp = ((symbol *) (((struct nlist *) (((char *)entry->symbols) + symindex))
  117. +     ->n_un.n_name));
  118.   #ifdef N_INDR
  119.     /* Resolve indirection */
  120.     if ((sp->defined & ~N_EXT) == N_INDR)
  121. ***************
  122. *** 4373,4378 ****
  123. --- 4384,4409 ----
  124.   #endif
  125.     return sp;
  126.   }
  127. + static char *
  128. + retsymname (p, entry, addr)
  129. +     struct relocation_info *p;
  130. +     struct file_entry *entry;
  131. +     int addr;
  132. + {
  133. +   register struct nlist *n;
  134. +   if (RELOC_EXTERN_P(p)) {
  135. +     register symbol *sp = retsym(p, entry);
  136. +     return sp->name;
  137. +   }
  138. +   for (n=entry->symbols;
  139. +     n<(struct nlist *)((long)entry->symbols + entry->header.a_syms); n++)
  140. +     if (n->n_value == addr)
  141. +     return(entry->strings + n->n_un.n_strx);
  142. +   return "(static symbol)";
  143. + }
  144.   /* Relocate ENTRY's text or data section contents.
  145.      DATA is the address of the contents, in core.
  146.      DATA_SIZE is the length of the contents.
  147. ***************
  148. *** 4406,4412 ****
  149.         register int relocation = 0;
  150.         register int addr;
  151.         register unsigned int mask = 0;
  152. !       symbol *sp;
  153.   
  154.   #ifdef BYTE_SWAP    /* swap relocation info */
  155.   { /* BITFIELD ALERT BITFIELD ALERT */
  156. --- 4437,4443 ----
  157.         register int relocation = 0;
  158.         register int addr;
  159.         register unsigned int mask = 0;
  160. !       int oldreloc;
  161.   
  162.   #ifdef BYTE_SWAP    /* swap relocation info */
  163.   { /* BITFIELD ALERT BITFIELD ALERT */
  164. ***************
  165. *** 4429,4434 ****
  166. --- 4460,4466 ----
  167.   
  168.         if (RELOC_EXTERN_P(p))
  169.       {
  170. +             register symbol *sp;
  171.         sp = retsym(p, entry);
  172.   
  173.         /* If the symbol is undefined, leave it at zero.  */
  174. ***************
  175. *** 4471,4476 ****
  176. --- 4503,4509 ----
  177.         if (RELOC_PCREL_P(p))
  178.       relocation -= pc_relocation;
  179.   
  180. +       oldreloc = relocation;
  181.   #ifdef RELOC_ADD_EXTRA
  182.         relocation += RELOC_ADD_EXTRA(p);
  183.   #endif
  184. ***************
  185. *** 4496,4548 ****
  186.         break;
  187.   
  188.       case 1:
  189.         if (RELOC_MEMORY_ADD_P(p)) {
  190. !         if (RELOC_PCREL_P(p))
  191. !           relocation += mask & *(short *) (data + addr);
  192.           else
  193. !           relocation += mask & *(unsigned short *) (data + addr);
  194.         }
  195.         if (relocation > 32767 || relocation < -32768) {
  196. !         sp = retsym(p, entry);
  197. !         error ("relocation out of range for %s in %s",
  198. !             sp->name, entry->filename);
  199.           make_executable = 0;
  200.         }
  201. !       *(short *) (data + addr) &= ~mask;
  202. !       *(short *) (data + addr) |= relocation;
  203.         break;
  204.   
  205.       case 2:
  206.   #ifndef WORD_ALIGNED
  207. !       if (RELOC_MEMORY_ADD_P(p))
  208. !         relocation += mask & *(long *) (data + addr);
  209. !       *(long *) (data + addr) &= ~mask;
  210. !       *(long *) (data + addr) |= relocation;
  211.   #else
  212. !       {
  213. !       register unsigned long word = 0;
  214.   
  215. !       word |= (unsigned char)(data[addr]) << 24;
  216. !       word |= (unsigned char)(data[addr+1]) << 16;
  217. !       word |= (unsigned char)(data[addr+2]) << 8;
  218. !       word |= (unsigned char)(data[addr+3]);
  219.   
  220.         if (RELOC_MEMORY_ADD_P(p))
  221.           relocation += mask & word;
  222.         if (pure_text && relocation > text_size+text_start) {
  223. !         sp = retsym(p, entry);
  224.           error ("absolute reference to %s from pure-text in %s",
  225. !         sp->name, entry->filename);
  226.           make_executable = 0;    /* set exit code */
  227.         }
  228.         word &= ~mask;
  229.         word |= relocation;
  230. !       data[addr] = word >> 24;
  231. !       data[addr+1] = (word >> 16) & 0xff;
  232. !       data[addr+2] = (word >> 8) & 0xff;
  233. !       data[addr+3] = word & 0xff;
  234. !       }
  235.   #endif
  236.         break;
  237.   
  238.       default:
  239. --- 4529,4615 ----
  240.         break;
  241.   
  242.       case 1:
  243. +     {
  244. +       register int word;
  245.         if (RELOC_MEMORY_ADD_P(p)) {
  246. !         if (RELOC_PCREL_P(p)||RELOC_EXTERN_P(p))
  247. !           word = *(short *) (data + addr);
  248.           else
  249. !           word = *(unsigned short *) (data + addr);
  250. ! #ifdef BYTE_SWAP
  251. !         word = SWAP2(word);
  252. ! #endif
  253. !         relocation += mask & word;
  254.         }
  255.         if (relocation > 32767 || relocation < -32768) {
  256. !         if (!RELOC_EXTERN_P(p))
  257. !           if (!entry->strings) {
  258. !         entry->strings = (char *) alloca (entry->string_size);
  259. !         read_entry_strings (file_open (entry), entry);
  260. !           }
  261. !         error ("fatal error: relocation out of range for %s in %s",
  262. !         retsymname(p, entry, oldreloc+word), entry->filename);
  263.           make_executable = 0;
  264.         }
  265. !       word &= ~mask;
  266. !       word |= relocation;
  267. ! #ifdef BYTE_SWAP
  268. !       word = SWAP2(word);
  269. ! #endif
  270. !       *(short *) (data + addr) = word;
  271. !     }
  272.         break;
  273.   
  274.       case 2:
  275. +     {
  276. +       register unsigned long word;
  277.   #ifndef WORD_ALIGNED
  278. !       word = *(long *) (data + addr);
  279. ! #ifdef BYTE_SWAP
  280. !       word = SWAP4(word);
  281. ! #endif /* BYTE_SWAP */
  282.   #else
  283. !       word = ((unsigned long)(unsigned char)(data[addr])) << 24;
  284. !       word |= ((unsigned long)(unsigned char)(data[addr+1])) << 16;
  285. !       word |= ((unsigned long)(unsigned char)(data[addr+2])) << 8;
  286. !       word |= ((unsigned long)(unsigned char)(data[addr+3]));
  287. ! #ifdef BYTE_SWAP
  288. !     /* NOTE: We dont need to swap 4 because we are constructing
  289. !        the word here */
  290. ! #endif
  291.   
  292. ! #endif
  293.   
  294.         if (RELOC_MEMORY_ADD_P(p))
  295.           relocation += mask & word;
  296.         if (pure_text && relocation > text_size+text_start) {
  297. !         if (!RELOC_EXTERN_P(p))
  298. !           if (!entry->strings) {
  299. !         entry->strings = (char *) alloca (entry->string_size);
  300. !         read_entry_strings (file_open (entry), entry);
  301. !           }
  302.           error ("absolute reference to %s from pure-text in %s",
  303. !         retsymname(p, entry, relocation), entry->filename);
  304.           make_executable = 0;    /* set exit code */
  305.         }
  306.         word &= ~mask;
  307.         word |= relocation;
  308. ! #if (defined(BYTE_SWAP) && (!defined(WORD_ALIGNED)))
  309. !       word = SWAP4(word);
  310. ! #endif
  311. ! #ifndef WORD_ALIGNED
  312. !       *(long *) (data + addr) = word;
  313. ! #else
  314. !       data[addr+3] = word;
  315. !       word >>= 8;
  316. !       data[addr+2] = word;
  317. !       word >>= 8;
  318. !       data[addr+1] = word;
  319. !       word >>= 8;
  320. !       data[addr] = word;
  321.   #endif
  322. +     }
  323.         break;
  324.   
  325.       default:
  326. ***************
  327. *** 4562,4567 ****
  328. --- 4629,4635 ----
  329.   }
  330.   #endif /* BYTE_SWAP */
  331.       }
  332. +     entry->strings = 0;
  333.   }
  334.   
  335.   /* For relocatable_output only: write out the relocation,
  336. *** 1.3    1992/10/11 02:39:24
  337. --- toglclr.c    1992/11/08 00:48:30
  338. ***************
  339. *** 21,26 ****
  340. --- 21,30 ----
  341.    *    (bammi@cadence.com) to toggle the clear TPA above BSS flag
  342.    *    introduced with TOS 1.4. I extended it to also handle the additional
  343.    *    program flags introduced with the TOS versions for the STE and TT.
  344. +  *
  345. +  * 31-Oct-1992        Thomas Schulze
  346. +  *    Added code for MiNT 0.96 (and up) shared text feature. -fshare
  347. +  *    will switch this flag.
  348.    */
  349.   
  350.   #include <stdio.h>
  351. ***************
  352. *** 149,154 ****
  353. --- 153,162 ----
  354.          (int)((t & F_ALTALLOC) == F_ALTALLOC),
  355.          (int)((head.a_AZero2 & F_ALTALLOC) == F_ALTALLOC));
  356.   
  357. +     printf("%s: `shared text' bit was %d is now %d\n", fn,
  358. +         (int)((t & F_SHTEXT) == F_SHTEXT),
  359. +         (int)((head.a_AZero2 & F_SHTEXT) == F_SHTEXT));
  360.       return 0;
  361.   }
  362.   
  363. ***************
  364. *** 165,171 ****
  365.       fprintf(stderr, "usage: toglclr [options] file file .....\n\n");
  366.       fprintf(stderr, "options: -fload = toggle `fast load' bit\n");
  367.       fprintf(stderr, "         -frun  = toggle `load program into fast ram' bit\n");
  368. !     fprintf(stderr, "         -fram  = toggle `malloc from fast ram' bit\n\n");
  369.       fprintf(stderr, "without options the current state is reported.\n");
  370.       exit(1);
  371.       }
  372. --- 173,180 ----
  373.       fprintf(stderr, "usage: toglclr [options] file file .....\n\n");
  374.       fprintf(stderr, "options: -fload = toggle `fast load' bit\n");
  375.       fprintf(stderr, "         -frun  = toggle `load program into fast ram' bit\n");
  376. !     fprintf(stderr, "         -fram  = toggle `malloc from fast ram' bit\n");
  377. !     fprintf(stderr, "         -fshare= toggle `shared text' bit\n\n");
  378.       fprintf(stderr, "without options the current state is reported.\n");
  379.       exit(1);
  380.       }
  381. ***************
  382. *** 178,183 ****
  383. --- 187,194 ----
  384.           flags_to_toggle |= F_ALTLOAD;
  385.           if (!strcmp(*argv, "-fram"))
  386.           flags_to_toggle |= F_ALTALLOC;
  387. +     if (!strcmp(*argv, "-fshare"))
  388. +         flags_to_toggle |= F_SHTEXT;
  389.       --argc;
  390.       }
  391.   
  392.